const {Sequelize, DataTypes} = require("sequelize");
const {connectMysql} = require("../core/config/database");

const database = connectMysql();
const defaultDataBaseConfig = {
    tableName: "ra_user",
    modelName: "ra_user",
    createdAt: false,
    updatedAt: false,
    deletedAt: false
}
module.exports = {
    RaUser: database.define('ra_user', {
        // 在这里定义模型属性
        id: {
            type: DataTypes.INTEGER,
            allowNull: false,
            comment: "角色ID",
            primaryKey: true
        },
        ra_username: {
            type: DataTypes.TEXT,
            allowNull: false
        },
        ra_password: {
            type: DataTypes.TEXT,
            allowNull: false
        },
        ra_phone_number: {
            type: DataTypes.TEXT,
            allowNull: false
        },
        ra_avatar: {
            type: DataTypes.TEXT,
            allowNull: false
        },
        ra_gender: {
            type: DataTypes.INTEGER,
            allowNull: false
        },
        ra_created_at: {
            type: DataTypes.DATE,
            allowNull: false,
            comment: "创建时间"
        },
        ra_email: {
            type: DataTypes.TEXT,
            allowNull: false,
            comment: "电子邮箱"
        }
    }, defaultDataBaseConfig)
}
